//
//  STAreasHeaderView.m
//  赛拓
//
//  Created by 王磊 on 8/16/16.
//  Copyright © 2016 立金所. All rights reserved.
//

#import "STAreasHeaderView.h"
@interface STAreasHeaderView()
@property (nonatomic ,strong) UILabel *totalAreas;
@end
@implementation STAreasHeaderView

- (void)commitInit {
    [super commitInit];
    UILabel *areaLabel = [UILabel new];
    
    self.totalAreas = areaLabel;
    
    areaLabel.textAlignment = NSTextAlignmentCenter;
    
    [self addSubview:areaLabel];
    
    areaLabel.textColor = ST_167EC0_COLOR;
    
    areaLabel.backgroundColor = ST_WHITE_COLOR;
    
    areaLabel.userInteractionEnabled = true;
    
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(totalAreasTriggered)];
    
    [areaLabel addGestureRecognizer:tap];
}

- (void)updateData:(id)data {
    
    self.totalAreas.text = data;
}
- (void)layoutSubviews {
    [super layoutSubviews];
    
    self.totalAreas.frame = CGRectMake(0, 0, ST_SCREEN_WIDTH / 4, 30);
    
}
- (void)totalAreasTriggered {
    
    [self.mDelegate onItemClick:STItemClickTypeTotalArea withData:nil forIndexPath:nil];
}
@end
